reference integer specifys the channel you want to pause. Use the
reference number obtained from the
SP Open Voice function.
err integer returns the error which occured.
A value of zero indicates no error occured. See
below for a list of possible errors.
Function to pause the specified speech channel speaking the lines.
The SP Voice Pause, SP Voice Cont and SP Voice Stop functions are perfectly suited to make a row of buttons to play, stop, pause and continue the speech of the selected text in a text field.
When you pass reference value -1 all currently opened speech channels will be paused.
Example:
`pause the voice until continue command
$err:=SP Voice Pause ($speechref)
`let the voice continue
$err:=SP Voice Cont ($speechref)
`stop speaking
$err:= SP Voice Stop ($speechref)
`the example below tries to open all installed voices and let them start
`speaking at the same time
For ($i;1;$count)
`get the voicename based on the index number
$err:=SP Voicename ($i;$voicename)
`open a speech channel for the voice
$err:=SP Open Voice ($voicename;$speechref)
If ($err=0)
`pass text and pause before start speaking
$err:=SP Voice Text ($speechref;$lines;1;1;4)
End if
End for
$err:=SP Voice Cont (-1) `now continue all voices
`at this point all voices will start speaking (gibberish) which will take
`a lot of CPU time!
While (SP Speaking >0)
`while anyone is speaking wait for it to finish
IDLE
End while
$err:=SP Close Voice (-1) `close all channels
Possible errors:
0 No Error
-4 Speech Pack can not be used (Speech Mgr not available)